function t(t) {
    return (t = t.toString())[1] ? t : "0" + t;
}

module.exports = {
    imageUtil: function(t) {
        var e = {}, i = t.detail.width, n = t.detail.height, r = n / i;
        return wx.getSystemInfo({
            success: function(t) {
                var a = t.windowWidth, o = t.windowHeight;
                r < o / a ? (e.imageWidth = a, e.imageHeight = a * n / i) : (e.imageHeight = o, 
                e.imageWidth = o * i / n);
            }
        }), e;
    },
    formatTime: function(e) {
        var i = e.getFullYear(), n = e.getMonth() + 1, r = e.getDate(), a = e.getHours(), o = e.getMinutes(), g = e.getSeconds();
        return [ i, n, r ].map(t).join("/") + " " + [ a, o, g ].map(t).join(":");
    },
    formatDate: function(t) {
        return t.getMonth() + 1 + "月" + t.getDate() + "日";
    },
    formatDate1: function(t) {
        return t.getFullYear() + "-" + (t.getMonth() + 1) + "-" + t.getDate();
    },
    formatNumber: t
};